from functools import reduce
lst = ['a', '2', '3c', '24', '', '9']
result = list(filter(lambda x: x.isdigit(), lst))
print(reduce(lambda x, y: x+y, result))

list1=[7, -8, 5, 4, 0, -2, -5]
print(sorted(list1, key=lambda x: x*-10 + 10 if x <= 0 else x))

s = 'asjfgks34GDScds23'
print(''.join(sorted(s, key=lambda x: (x.isdigit(), x.isdigit() and int(x) % 2 == 0, x.isupper(), x))))
